package com.github.wxiaoqi.security.biz.biz;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.github.wxiaoqi.security.biz.entity.BhResumUsed;
import com.github.wxiaoqi.security.biz.mapper.BhResumUsedMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;

/**
 * 已投简历表    简历发送到企业后不能更改
 *
 * @author Mr.AG
 * @email 463540703@qq.com
 * @date 2018-05-16 10:29:09
 */
@Service
public class BhResumUsedBiz extends BaseBiz<BhResumUsedMapper,BhResumUsed> {
	//已查看简历
	public Integer queryViewedResumen(Map<String, Object> req) {
		String custNo = (String) req.get("custNo");
		if(null == custNo || "".equals(custNo)){
			return 0;
		}
		Date today = new Date();
		Date yesterday = new Date(today.getTime() - 86400000L);
		String yesterdayString = new SimpleDateFormat("yyyy-MM-dd").format(yesterday);
		String start = yesterdayString + " 00:00:00";
		String end = yesterdayString + " 23:59:59";
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("start", start);
		map.put("end", end);
		map.put("custNo", custNo);
		map.put("status", "0");
		int count = mapper.getCount(map);
		return count;
	}
	//已淘汰简历
	public Integer queryOutResumen(Map<String, Object> req) {

		String custNo = (String) req.get("custNo");
		Date today = new Date();
		Date yesterday = new Date(today.getTime() - 86400000L);
		String yesterdayString = new SimpleDateFormat("yyyy-MM-dd").format(yesterday);
		String start = yesterdayString + " 00:00:00";
		String end = yesterdayString + " 23:59:59";
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("start", start);
		map.put("end", end);
		map.put("custNo", custNo);
		map.put("statuss", "2");
		int count = mapper.getCount(map);
		return count;
	
	}
	//收到待查看简历
	public Integer queryNoView(Map<String, Object> req) {
		String merNo = (String) req.get("merNo");
		
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("merNo", merNo);
		map.put("status", "0");
		Integer noViewCount = mapper.getCountNoView(map);
		return noViewCount;
	}
}